package com.cis.modules.quickstart.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.cis.commom.Response;
import com.cis.modules.quickstart.entity.User;

@RestController
@RequestMapping("/user")
public class UserConttroller {

    @RequestMapping("/hello")
    public String hello() {
        return "hello";
    }

    /**
     * GET and POST
    */
    @RequestMapping(path = "/get", method = {RequestMethod.GET, RequestMethod.POST})
    public Response get() {
        User user = new User();
        user.setId(1L);
        user.setName("test name");
        return Response.ok().set("data", user);
    }

}
